<template>
  <view class="container">
    <uni-forms :modelValue="form" label-width='200rpx'>
      <uni-forms-item label="学历类型" name="eduBackground1">
        <uni-data-checkbox v-model="form.eduBackground1" :localdata="[{value:'bk',text:'大学本科'}]"
                           multiple></uni-data-checkbox>
      </uni-forms-item>
      <uni-forms-item label="院校范围" name="schoolRange1">
        <uni-data-select v-model="form.schoolRange1" :localdata="schoolRanges" :disabled="disabled1"
                         placeholder="请选择院校范围"></uni-data-select>
      </uni-forms-item>
      <uni-forms-item label="申领金额" name="amount1">
        <uni-easyinput type="number" v-model="form.amount1" placeholder="请输入申领金额" :disabled="disabled1"/>
      </uni-forms-item>
      <uni-forms-item label="学历类型" name="eduBackground2">
        <uni-data-checkbox v-model="form.eduBackground2" :localdata="[{value:'ss',text:'硕士研究生'}]"
                           multiple></uni-data-checkbox>
      </uni-forms-item>
      <uni-forms-item label="院校范围" name="schoolRange2">
        <uni-data-select v-model="form.schoolRange2" :localdata="schoolRanges" :disabled="disabled2"
                         placeholder="请选择院校范围"></uni-data-select>
      </uni-forms-item>
      <uni-forms-item label="申领金额" name="amount2">
        <uni-easyinput type="number" v-model="form.amount2" placeholder="请输入申领金额" :disabled="disabled2"/>
      </uni-forms-item>
      <uni-forms-item label="学历类型" name="eduBackground3">
        <uni-data-checkbox v-model="form.eduBackground3" :localdata="[{value:'bs',text:'博士研究生'}]"
                           multiple></uni-data-checkbox>
      </uni-forms-item>
      <uni-forms-item label="院校范围" name="schoolRange3">
        <uni-data-select v-model="form.schoolRange3" :localdata="schoolRanges" :disabled="disabled3"
                         placeholder="请选择院校范围"></uni-data-select>
      </uni-forms-item>
      <uni-forms-item label="申领金额" name="amount3">
        <uni-easyinput type="number" v-model="form.amount3" placeholder="请输入申领金额" :disabled="disabled3"/>
      </uni-forms-item>
    </uni-forms>
    <view class="tip">
      <uni-icons type="help" size="20"></uni-icons>
      <text style="font-size: 12px;">
        【{{ currentSyr.name }}】进入“大学本科”（且应为【院校范围】院校/“硕士研究生”（且应为【院校范围】院校）/“博士研究生”（且应为【院校范围】院校）学习时，【{{ currentSyr.name }}】书面同志受托人并提供【{{ currentSyr.name }}】的有效学籍证明等材料后，可一次性申领不超过【{{ form.amount1 || '申领金额1' }}】/【{{ form.amount2 || '申领金额2' }}】/【{{ form.amount3 || '申领金额3' }}】万元。同等学历的情况下，仅限申领一次。如无需填写，则选择跳过。
      </text>
    </view>
    <view class="bottom" style="display: flex;justify-content: center">
      <button class="button" type="primary" @click="jump(204)">跳过</button>
      <button class="button" type="primary" @click="submit">下一步</button>
    </view>
  </view>
</template>

<script>
import variables from '@/static/js/variables.js'
import userInfoMixin from "../../common/js/userInfoMixin";

export default {
  mixins: [userInfoMixin],
  data() {
    return {
      name: '203',
      form: {
        eduBackground1: [],
        schoolRange1: '',
        amount1: '',
        eduBackground2: [],
        schoolRange2: '',
        amount2: '',
        eduBackground3: [],
        schoolRange3: '',
        amount3: '',
      },
      eduBackgroundRange: [],
      schoolRanges: []
    }
  },
  computed: {
    disabled1() {
      return this.form.eduBackground1.length === 0
    },
    disabled2() {
      return this.form.eduBackground2.length === 0
    },
    disabled3() {
      return this.form.eduBackground3.length === 0
    },
  },
  created() {
    this.schoolRanges = variables.schoolRanges
    this.eduBackgroundRange = variables.eduBackgroundRange
  },
  methods: {
    change() {

    },
    prevStep() {
      uni.navigateTo({
        url: '/pages/202syrfpj/202syrfpj',
        success() {
          console.log('succ')
        },
        fail() {
          console.log('failed')
        }
      })
    },
    submit() {
      // 毕业奖励金
      this.submitData({key: 'byjlj', data: this.form}, '204')

    },
  }
}
</script>

<style>

</style>
